﻿<link href="@Url.Content("~/content/activitie_detail.css")" rel="stylesheet" type="text/css"/>

@model IEnumerable<PessModel.Rule>

@{
    ViewBag.Title = "Details";
}
<div id="m-title">
    <h2>评分详细信息</h2>
    <div id="m-op" class="fromSubject">

        @if ((bool)ViewBag.ShowCreateRuleButton)
        {
            if (Roles.IsUserInRole("Admin"))
            {
                using (Html.BeginForm("CopyRulesFromSubject", "Rule", FormMethod.Post))
                {
                    <span>从学科导入规则：</span>
                    @Html.DropDownList("SubjectID", (SelectList)ViewBag.SubjectID)
                    <input type="submit" value="导入" class="u-btn" />
                    @Html.Hidden("TargetSubjectID", (int)ViewData["subjectID1"])
                }
            }
            <span>&#8195;</span>@Html.ActionLink("新建", "Create", new { subjectID = ViewData["SubjectID1"] }, null)
        }
        <span>&#8195;</span>@Html.ActionLink("返回", "Index", new { activityID = ViewBag.ActivityID }, null)
    </div>
</div>
<fieldset class="fly-edit">
        <div class="m-sd-xx m-sd-title">
            <div class="title">
                @ViewBag.SubjectName
            </div>
            <div class="sidebd">
                <table>
                    <tr>
                        @*<th>
                    @Html.DisplayNameFor(model => model.SubjectID)
                </th>*@
                        <th style="width:200px">
                            @*@Html.DisplayNameFor(model => model.Name)*@名称
                        </th>
                        <th>
                            @*@Html.DisplayNameFor(model => model.Description)*@说明
                        </th>
                        <th style="width:100px">
                            @*@Html.DisplayNameFor(model => model.Value)*@分值
                        </th>
                        <th></th>
                    </tr>

                    @foreach (var item in Model)
                    {
                        <tr>
                            @*<td>
                        @Html.DisplayFor(modelItem => item.SubjectID)
                    </td>*@
                            <td>
                                @Html.DisplayFor(modelItem => item.Name)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Description)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Value)
                            </td>
                            <td class="thAction">
                                @if (Roles.IsUserInRole("Admin") || (bool)ViewBag.ShowCreateRuleButton)
                                {
                                    @Html.ActionLink("编辑", "Edit", new { ruleID = item.ID })
                                    @*                @Html.ActionLink("详细", "Details", new { id=item.ID }) |*@
                                    @Html.ActionLink("删除", "Delete", new { ruleID = item.ID })
                                }
                            </td>
                        </tr>
                    }
                </table>
            </div>
        </div>
</fieldset>